<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>案例01.变量的使用_2024-01-16</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }
    </style>
    <script>
        /*弹出一个输入框，提示用户输入姓名。
         弹出一个对话框，输出用户刚才输入的姓名。*/
        /*let name = prompt("请输入您的姓名");
        alert(`您输入的姓名是${name}`);*/
        // let now = new Date("2024-1-25 17:00:00");
        // console.log(now)
        let start = new Date();
        let end = new Date("2024-02-01 00:00:00");
        console.log(end)
        //576481795 -> 天 小时 分 秒
        //
        let ms = end - start;
        let seconds = ms / 1000;
        let days = Math.floor(seconds / 3600 / 24);
        let hours = Math.floor(seconds / 3600 % 24)
        let minutes = Math.floor(seconds / 60 % 60)
        let diffs = Math.floor(seconds % 60)
        console.log(seconds)
        console.log(days, hours,minutes,diffs)
    </script>
</head>
<body>

</body>
</html>